package com.yigo.cuc.gateway.controller;

import com.yigo.cuc.api.customer.CustomerQueryFeign;
import com.yigo.cuc.api.customer.query.CustomerListQuery;
import com.yigo.cuc.api.customer.resp.CustomerListResp;
import com.yigo.cuc.app.representation.CustomerQueryAppService;
import com.yigo.framework.http.Q;
import com.yigo.framework.http.R;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.*;

/**
 * @author chenzl
 */
@RestController
public class CustomerQueryController implements CustomerQueryFeign {
    @Resource
    private CustomerQueryAppService customerQueryAppService;
    @Override
    public R<List<CustomerListResp>> queryCustomerList(Q<CustomerListQuery> q) {
        List<CustomerListResp> list=customerQueryAppService.queryCustomerList(q.getNonNullParams());
        return R.ok(list);
    }

    @Override
    public R<List<CustomerListResp>> queryCustomerPage(Q<CustomerListQuery> q) {
        return customerQueryAppService.queryCustomerPage(q.getNonNullParams());
    }
}
